<%@ Page EnableEventValidation="false" Language="C#" MasterPageFile="app-frame.master" AutoEventWireup="true" CodeFile="import.aspx.cs" Inherits="app_frame_import" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder3" Runat="Server"> 
    <form name="tstest">
    <table width="100%" border="0" bordercolor="red" cellpadding="0" cellspacing="0">    
    <tr><td><asp:Label runat="server" ID="lblMess" Text=""></asp:Label> </td></tr>
    <tr>
    <td>
    <table width="100%" cellpadding="0" cellspacing="0" border="0" runat="server" id="tblcontrols">
    <tr>
        <td>
        <table width="100%" border="0" bordercolor="black" cellpadding="0" cellspacing="0">
    <tr>
    <td class="Dynamic_PageHeaderRow" style="height: 32px">
       <span></span><span style="font-size: 10pt;" class='defaultFont'>&nbsp;<asp:Label ID="lblHeader" runat="server" Text="Import - Add"></asp:Label></span><br />
       <asp:HiddenField ID="hfRequestURL" runat="server" />
    </td>
    <td style="width: 5px;"></td>
    </tr>
        <tr>
            <td id="td_Page_ToolTip" runat="server" colspan="2">
            </td>
        </tr>
        <tr>
            <td colspan="2" style="height: 21px" valign="top">
            <table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td style="width:85%"><asp:Label ID="lbl_message" runat="server" CssClass='defaultFont' Font-Size="X-Small"
            ForeColor="Black"></asp:Label></td><td style="text-align: right;width:15%"><span style="font-size: 10pt;" class='defaultFont'><strong>&nbsp;</strong>
                </span></td>
       </tr></table></td>
        </tr>        
    <tr style="display:none;">
    <td style="height: 21px; width: 208px;" valign="top"> 
        <span class="controlLabelFont">&nbsp;Name</span></td>
    <td style="height: 21px; text-align: left;"> 
        <span style="font-size: 10pt;" class='defaultFont'><asp:TextBox ID="p_simple_import_import_name" runat="server" Width="200px" CssClass="controlFont"></asp:TextBox>&nbsp;<img src="Images/star.gif" alt="Required Field" />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="p_simple_import_import_name"
                Display="None" ErrorMessage="This is a required field." Enabled="False"></asp:RequiredFieldValidator>&nbsp;
            <cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" TargetControlID="RequiredFieldValidator1"
                WarningIconImageUrl="Images/warning_small.gif" HighlightCssClass="maskInvalid">
            </cc1:ValidatorCalloutExtender>
            &nbsp;
        </span></td>
    </tr>
        </table> 
        </td>
    </tr>
    
    
    <tr>
        <td>
        <table width="100%" border="0" bordercolor="black" cellpadding="1px" cellspacing="0">
         <tr style="display:none;">
        <td style="width: 209px" valign="top"> 
            <span class="controlLabelFont">&nbsp;Notes</span></td>        
        <td>
            <asp:TextBox ID="p_simple_import_notes" runat="server" Rows="4" TextMode="MultiLine" Width="201px" CssClass="controlFont"></asp:TextBox>
            &nbsp;
        </td><td>
                <span style="font-size: 10pt;" class='defaultFont'></span></td>
    </tr>    
             <tr>
                 <td style="width: 209px;">
                     </td>
                 <td>
                     </td>
                 <td>
                 </td>
             </tr>
             <tr>
                 <td style="width: 209px; height: 28px;vertical-align:top;">
                     <span class="controlLabelFont">&nbsp;Target Object</span></td>
                 <td style="height: 28px">
                     <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                         <ContentTemplate>
                            <table border="0" cellpadding="2" cellspacing="0">
                                                         <%--Position changed by Bala for loading icon issue on 18 July 2012--%>
                            <tr><td><asp:DropDownList ID="p_simple_import_target_object" runat="server" Width="185px" CssClass="controlFont" OnSelectedIndexChanged="p_simple_import_target_object_SelectedIndexChanged" AutoPostBack="True">
                     </asp:DropDownList>
                     <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
                         <ProgressTemplate>
                             <img src="Images/load.gif" />
                         </ProgressTemplate>
                     </asp:UpdateProgress></td></tr>

                            <tr><td class="controlLabelFont">Download Template&nbsp;<asp:Label ID="lblXLSLink" runat="server" CssClass="controlFont"></asp:Label>&nbsp;<asp:Label ID="lblCSVLink" runat="server" CssClass="controlFont"></asp:Label></td></tr>
                                <%--<tr><td><asp:Label ID="lblXLSLink" runat="server" CssClass="controlFont"></asp:Label></td></tr>
                                <tr><td><asp:Label ID="lblCSVLink" runat="server" CssClass="controlFont"></asp:Label></td></tr>                             --%>
                             </table>
                         </ContentTemplate>
                       <%--  <Triggers>
                             <asp:AsyncPostBackTrigger ControlID="p_simple_import_target_object" EventName="SelectedIndexChanged" />
                         </Triggers>--%>
                     </asp:UpdatePanel>
            <asp:HiddenField ID="p_simple_import_af_row_id" runat="server" />
        </td>
                 <td style="height: 28px">
                     <span style="font-size: 10pt;" class='defaultFont'></span>
                 </td>
             </tr>
             <tr>
                 <td style="width: 209px;">
                 </td>
                 <td>
                 </td>
                 <td>
                 </td>
             </tr>
             <tr>
                 <td style="width: 209px; height: 28px;vertical-align:top;">
                     <span class="controlLabelFont">&nbsp;Import Source File&nbsp<img src="Images/star.gif" alt="Required Field" /><br />
                         &nbsp;(Maximum file size: 4MB)</span></td>
                 <td style="height: 28px" align="left">
                     <asp:FileUpload ID="FileUpload1" runat="server" Width="285px" CssClass="controlFont" /><asp:RequiredFieldValidator
                         ID="RequiredFieldValidator2" runat="server" ControlToValidate="FileUpload1" Display="None"
                         Enabled="true" ErrorMessage="This is a required field."></asp:RequiredFieldValidator><cc1:ValidatorCalloutExtender
                             ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="maskInvalid"
                             TargetControlID="RequiredFieldValidator2" WarningIconImageUrl="Images/warning_small.gif">
                         </cc1:ValidatorCalloutExtender>
                 </td>
                 <td style="height: 28px">
                     <span style="font-size: 10pt;" class='defaultFont'></span>
                 </td>
             </tr>
             <%--Added by 'Imran Gani' on 12-Jul-2013, for avoiding duplicates from import--%>
             <tr><td style="height:5px;"></td></tr>
             <tr><td colspan="2">
             <table id="tbl_advanced_options" runat="server" width="100%" border="0" cellpadding="0" cellspacing="0" class="NotesTable">
             <tr>
                 <td class="Dynamic_PageHeaderRow" style="width: 194px" valign="bottom" colspan="2" onclick="javascript:showHideDIVAdv();">&nbsp;<img id="img_advanced" style="cursor:pointer" title="Click to expand" alt="Click to toggle advanced options" src="Images/expand3.gif"/>
                 <span style="font-size: 9pt;" class="defaultFont">&nbsp;Advanced Options</span></td>                
             </tr>
             <tr>
                <td colspan="2">
                <div id="div_advanced" style="display:none;">
                    <table width="100%" border="0" cellpadding="1" cellspacing="0">
                        <tr>
                            <td style="width: 209px; height: 28px;vertical-align: middle;">
                                <span class="controlLabelFont">&nbsp;Avoid duplicates based on:</span></td>
                            <td style="width: 190px; height: 28px;vertical-align: middle;">
                                <asp:DropDownList ID="p_simple_import_avoid_duplicates_based_on" runat="server" Width="185px" CssClass="controlFont" onchange="javascript:document.getElementById('ctl00_ContentPlaceHolder3_hf_avoid_duplicates_based_on').value = this.value;"></asp:DropDownList>
                                <asp:HiddenField ID="hf_avoid_duplicates_based_on" Value="" runat="server" />
                            </td>
                            <td style="height: 28px;vertical-align: middle;">
                                <img alt="Help" title="click here to know more about Avoiding duplicates." style="cursor:pointer;" src="icons/help_on.gif" onclick="document.getElementById('div_help_avoid_dup').style.display = 'block';" />
                                <div id="div_help_avoid_dup" class="defaultFont" style="width:380px; height: 105px; display:none; z-index:1; position:absolute; background-color:White; min-width:200px; padding: 0px 0px 0px 0px; border:solid 1px #000000; overflow:scroll;" >
                                <table style="margin-left:4px;" border='0' cellpadding='3' cellspacing='0'>
                                <tr>
                                    <td align='right'>
                                        <a href='#' style="margin-right:5px;" onclick="javascript:document.getElementById('div_help_avoid_dup').style.display='none';return false;"><img border='0' src='Images/xClose.gif' alt="Close this window" title='Close this window'/></a>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <span style="font-size: 10pt;" class="defaultFont">-- Default Settings -- will avoid duplicates based on unique fields, already configured in the system.</span></td> 
                                </tr>
                                <tr>
                                    <td>
                                        <span style="font-size: 10pt;" class="defaultFont">Other option's will avoid duplicates based on selected field.</span></td> 
                                </tr>
                                </table>
                                </div>
                                <span id="avoid_duplicates_err" style="vertical-align:text-top; color:Red;" class="controlFont"></span>
                            </td>
                        </tr>
                    </table>
                </div>
                </td>
             </tr>
             </table>
             </td></tr>
             <%--Added by bala for creating the space on 22may2012--%>
             <tr><td style="height:10px;"></td></tr>
             <tr class="Dynamic_HtmlTableBottom">
             <td style="width: 209px; vertical-align:middle;"></td> <%--height: 28px;--%>
             <td align="left" valign="middle">
                 <table border="0" cellpadding="0" cellspacing="0">
                     <tr>
                         <td valign="top">
             <input type="button" value="Save" id="btnSave" runat="server" onserverclick="btnSave_ServerClick" onclick="javascript:showLoad(true);" /><input type="button" value="Save" id="btnUpdate" runat="server" onserverclick="btnUpdate_ServerClick" onclick="javascript:showLoad(false);" /><input type ="button" OnClick="aspnetForm.reset();return false;" value="Reset" id="btnReset" runat="server" onserverclick="btnreset_ServerClick" causesvalidation="false"/>
             <%--<input type="submit" value="Import" id="btnImport" runat="server" onserverclick="btnImport_ServerClick" onclick="javascript:return checkExtension(); showLoad(true); " />--%><!--Srivatsan testing-->
             <asp:Button id="btnImport" Text="Import now" runat="server" OnClientClick="javascript:return checkExtension(); showLoad(true);" OnClick="btnImport_ServerClick" style="width:185px"/>
             <asp:LinkButton ID="lnkImportStats" runat="server" CssClass="controlFont handCursor" Text="Import Statistics" OnClientClick="javascript:ResetMessage();" OnClick="lnkImportStats_Click" ToolTip="Show Import Statistics" CausesValidation="false"></asp:LinkButton> <%--showHideStats();--%>
             <%--<asp:LinkButton ID="lnkImportStats" runat="server" CssClass="controlFont handCursor" Text="Import Statistics" OnClientClick="javascript:ResetMessage();" OnClick="lnkImportStats_Click" ToolTip="Show Import Statistics"></asp:LinkButton>--%>
             </td>
             
                         <td valign="top">
                             &nbsp;</td>
                     </tr>
                 </table>
            <%--<a id="lnkImportStats" href="#" onclick="javascript:showHideStats();"><span style="font-size: 10pt;">Import Statistics</span></a>--%>
                 
            </td>
             <%--<td></td> style="height: 28px"--%>
             </tr>
             <%--<tr><td align="center" style="height: 30"></td></tr>--%>
             <tr>
             <td colspan="3">
             <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                <table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
                    
                    <tr>
                        <td>
                       <%-- <br />--%>
                            <asp:Panel ID="pnlStatistics" runat="server" Width="100%" Visible="true" BorderColor="lightgray" style="display:none"> 
                            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                            <tr><td style="width:1px;background-color:Transparent"></td>
                                <td class="pgForm_title" style="background-color:Transparent">
                                <asp:Label ID="lblstats" runat="server" Text="Import Statistics"></asp:Label>
                                
                            </td>
                            </tr>
                            <tr>
                            <td id="td_Import_stats" runat="server" colspan="3"> 
                            </td>
                            </tr>
                            </table>
                 <%--                      <cc1:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server" CollapseControlID="lnkImportStats"
                     Enabled="True" ExpandControlID="lnkImportStats"
                     ExpandDirection="Horizontal" 
                     SuppressPostBack="false" TargetControlID="pnlStatistics">
                 </cc1:CollapsiblePanelExtender>--%>
                            </asp:Panel>
                 
                                            
                        </td>
                        <td style="width: 4px;"></td>
                    </tr>
                </table>
                </ContentTemplate>
                 <Triggers>
                     <asp:AsyncPostBackTrigger ControlID="lnkImportStats" EventName="Click" />
                 </Triggers>
                </asp:UpdatePanel>
             </td>
             </tr>
    </table>
        </td>
    </tr>
    
    
    <tr>
        <td>
        <table width="100%" border="0" bordercolor="black" cellpadding="0" cellspacing="0">
        <%--<tr>
            <td style="width: 208px; height: 26px">
            </td>
            <td style="height: 26px; text-align: left">
            </td>
        </tr>--%>
    <%--<tr>
    <td style="height: 26px; width: 208px;"> 
        <span style="font-size: 10pt; font-family: Arial">
            </span></td>
    <td style="height: 26px; text-align: left;"> <!-- Old place for buttons-->
        
        </td>
    </tr>    
        <tr>
            <td style="height: 26px; text-align: left" colspan="2"> <!-- Old place for stats-->
                
            </td>
        </tr>--%>
        <%--class="Dynamic_HtmlTableBottom"--%>
        <%--<tr> 
            <td style="width: 208px; height: 26px">
            </td>
            <td style="height: 26px; text-align: left">
            </td> 
        </tr>--%> <%--style="height: 26px"--%>
        <tr>
            <td>
                &nbsp;<asp:UpdatePanel ID="UpdatePanel3" runat="server">
                    <ContentTemplate>
            <asp:Label ID="lblStatusUpload" runat="server" CssClass='defaultFont' Font-Size="X-Small"></asp:Label>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
            <td style="width:1%;"></td>
        </tr>
        <tr id="errorTr" runat="server" style="display:none;">
            <td colspan="2" > <%--style="height: 26px"--%>
                <img id="img_advanced_sta" style="cursor:hand" alt="Click to toggle this view" src="Images/expand3.gif" onclick="javascript:showHideDIVAdv();" />
                <a href="#" onclick="javascript:showHideDIVAdv();return false;"><span style="font-size: 10pt;" class='defaultFont'>Click here for the error messages</span></a></td>
        </tr>
    </table>
        </td>
    </tr>
    
    
    <tr>
        <td>
        <div id="div_advanced_sta" style="display:none;border:solid 0px #000000">
         <table width="100%" border="0" bordercolor="black" cellpadding="0" cellspacing="0">
        <tr>
            <td><asp:Label id="lblStatistics" runat="server" Font-Size="X-Small" CssClass='defaultFont'></asp:Label>
            </td>
            </tr>
            </table>
            </div>   
        </td>
    </tr>
    </table>
    </td></tr><tr>        
    <td align="left">
        &nbsp;&nbsp;<asp:HiddenField ID="hfdeleteclick" Value="0" runat="server" />
    </td>
    </tr>     
  </table>
  </form>
  <script language="javascript" type="text/javascript" src="scripts/import.js"></script>
  
</asp:Content>
  
